package com.nabi.starter.common.exception;

/**
 * @author CAOYOU
 * @Title: ApiErrCode
 * @date 2019/10/1714:08
 */
public class ApiCode implements ErrorCode {

    private Integer code;
    private String msg;
    private Integer errorCode;
    private String errorMsg;

    public ApiCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ApiCode(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
        this.errorCode = errorCode.getCode();
        this.errorMsg = errorCode.getMsg();
    }

    public ApiCode(ErrorCode code, Integer errorCode, String errorMsg) {
        this.code = code.getCode();
        this.msg = code.getMsg();
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public ApiCode(Integer code, String msg, Integer errorCode, String errorMsg) {
        this.code = code;
        this.msg = msg;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }


    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public Integer getErrorCode() {
        return errorCode;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }
}
